package com.exercise;

import java.util.Objects;

public class Student01 {
    private String name;
    private String sex;
    private Integer age;
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
    Student01(){};
    public Student01(String name, String sex, int age) {
        this.name = name;
        this.sex = sex;
        this.age = age;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Student01 student01 = (Student01) o;
        return age == student01.age &&
                Objects.equals(name, student01.name);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, sex, age);
    }
}
